package com.imooc.sell.utils;

import com.imooc.sell.vo.ResultVo;

public class ResultVoUtil {
    public static<T> ResultVo<T> success(T t){
        ResultVo<T> resultVo=new ResultVo<>();
        resultVo.setCode(0);
        resultVo.setMessage("成功");
        resultVo.setData(t);
        return resultVo;
    }

    public static<T> ResultVo<T> success(){
        return success(null);
    }

    public static ResultVo error(Integer code,String message){
        ResultVo resultVo=new ResultVo();
        resultVo.setCode(code);
        resultVo.setMessage(message);
        return resultVo;
    }
}
